package com.example.springboot2023nocv.controller;

import com.example.springboot2023nocv.entity.NocvData;
import com.example.springboot2023nocv.entity.NocvGlobalData;
import com.example.springboot2023nocv.service.GlobalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

//@Controller
@RestController
public class GlobalController {

    @Autowired
    private GlobalService globalService;


    @GetMapping("/queryGlobal")
//    @RequestMapping("/queryGlobal")
//    @ResponseBody
    public List<NocvGlobalData> queryGlobalData(){
        List<NocvGlobalData> list = globalService.list();
        return list;
    }
}
